﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Exentials.Xoox.Spreadsheet
{
    public class XCol : XElementBase
    {

        //3 <attribute name="min" type="xsd:unsignedInt" use="required"/>
        //4 <attribute name="max" type="xsd:unsignedInt" use="required"/>
        //5 <attribute name="width" type="xsd:double" use="optional"/>
        //6 <attribute name="style" type="xsd:unsignedInt" use="optional" default="0"/>
        //7 <attribute name="hidden" type="xsd:boolean" use="optional" default="false"/>
        //8 <attribute name="bestFit" type="xsd:boolean" use="optional" default="false"/>
        //9 <attribute name="customWidth" type="xsd:boolean" use="optional" default="false"/>
        //10 <attribute name="phonetic" type="xsd:boolean" use="optional" default="false"/>
        //11 <attribute name="outlineLevel" type="xsd:unsignedByte" use="optional" default="0"/>
        //12 <attribute name="collapsed" type="xsd:boolean" use="optional" default="false"/>

        private XAttributeBase<int> _min;
        private XAttributeBase<int> _max;
        private XAttributeBase<double> _width;
        private XAttributeBase<int> _style;
        private XAttributeBase<bool> _hidden;
        private XAttributeBase<bool> _bestFit;
        private XAttributeBase<bool> _customWidth;
        private XAttributeBase<bool> _phonetic;
        private XAttributeBase<bool> _outlineLevel;
        private XAttributeBase<bool> _collapsed;

        public XCol(int minColumn, int maxColumn)
            : base("col")
        {
            _min = new XAttributeBase<int>(this, "min") { Value = minColumn };
            _max = new XAttributeBase<int>(this, "max") { Value = maxColumn };
            _width = new XAttributeBase<double>(this, "width");
            _style = new XAttributeBase<int>(this, "style");
            _hidden = new XAttributeBase<bool>(this, "hidden");
            _bestFit = new XAttributeBase<bool>(this, "bestFit");
            _customWidth = new XAttributeBase<bool>(this, "customWidth");
            _phonetic = new XAttributeBase<bool>(this, "phonetic");
            _outlineLevel = new XAttributeBase<bool>(this, "outlineLevel");
            _collapsed = new XAttributeBase<bool>(this, "collapsed");
        }

        public int Min
        {
            get { return _min.Value; }
            set { _min.Value = value; }
        }

        public int Max
        {
            get { return _max.Value; }
            set { _max.Value = value; }
        }

        public double Width
        {
            get { return _width.Value; }
            set { _width.Value = value; }
        }

        public int Style
        {
            get { return _style.Value; }
            set { _min.Value = value; }
        }

        public bool Hidden
        {
            get { return _hidden.Value; }
            set { _hidden.Value = value; }
        }

        public bool BestFit
        {
            get { return _bestFit.Value; }
            set { _bestFit.Value = value; }
        }

        public bool CustomWidth
        {
            get { return _customWidth.Value; }
            set { _customWidth.Value = value; }
        }

        public bool Phonetic
        {
            get { return _phonetic.Value; }
            set { _phonetic.Value = value; }
        }

        public bool OutlineLevel
        {
            get { return _outlineLevel.Value; }
            set { _outlineLevel.Value = value; }
        }

        public bool Collapsed
        {
            get { return _collapsed.Value; }
            set { _collapsed.Value = value; }
        }

    }
}
